(load "F:/class/NLPLab/workspace/nlp-lab/genkit/givenfns.lisp")

(defun get-value (fs id)
  (second (assoc id fs))
  )

;; INFLECT-NOUN   (input: root, fs; output: inflected string)
;;   -- If (NUMBER PL), add "s" to root.
(defun inflect-noun (root fs)
  (if (equal (get-value fs 'number) 'pl)
      (concatenate 'string root "s")
      root))


;; INFLECT-VERB   (input: root, fs; output: inflected string)
;;   -- If (NUMBER SG) and (PERSON 3), add "s" to root.
(defun inflect-verb (root fs)
  (if (and (equal (get-value (get-value fs 'subj) 'number) 'sg)
           (equal (get-value (get-value fs 'subj) 'person) 3))
      (concatenate 'string root "s")
      root))

;; CREATE-PRONOUN (input: fs; output: string)
;;   -- All combinations of features and desired outputs can
;;      be seen in <a href="test-code.lisp">test-code.lisp</a>.
(defun create-pronoun (fs &aux person number)
  (setf person (get-value fs 'person))
  (setf number (get-value fs 'number))
  
  (case person
    (3 (case number
         (sg "s/he")
         (pl "they")))
    (2 (case number
         (sg "you")
         (pl "you")))
    (1 (case number
         (sg "I")
         (pl "we")))))